/**
 * 
 */
package carlyang;

import java.time.LocalDateTime;
import java.util.*;


class A{
	int num = 5;
	private int myval = 10;
	{
		System.out.println("A的构造代码块,num="+num);
	}
	static {
		System.out.println("A的静态代码块");
	}
	A(){
		System.out.println("A的构造方法");
		this.show();
	}
	public void show() {
		System.out.println("A show->num="+num);
	}
	
	public void test() {
		//System.out.println("A test->num="+num);
		this.show();
	}
} 

class B extends A{
	int num = 50;
	{
		System.out.println("B的构造代码块，num="+super.num);
	}
	static {
		System.out.println("B的静态代码块");
	}
	B(){
		//编译器会先隐性的调用super();//父类的构造函数创建父类的对象
		//super();//必须放第一句
		System.out.println("-------------------------");
		System.out.println("B的构造方法");
		this.show();
		super.show();
	}
	@Override
	public void show() {
		System.out.println("B show->num="+num);
	}
} 
/**
 * @author yangdong
 * 
 */
public class mytest {

	/**
	 * @param args
	 */
	public static int test_flag = 0;
	/**
	 * @param <E>
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		long currentTime = System.currentTimeMillis();
		System.out.println(mytest.class + "\nCTime:"+currentTime);
 		long time = Date.UTC(2016-1900, 2, 9, 14-8, 54, 30);
 		System.out.println("Current wall time:"+LocalDateTime.now());
 		System.out.println("Current local time:"+new Date().toLocaleString());

//		B btest  = new B();
//		//String str = "Hello!";
//		System.out.println(btest.getClass());
//		A a = new B();
//		System.out.println(A.class);
 		A aClass = new B();
 		System.out.println("----------------------------------");
 		aClass.show();
	}
	
/* 输入方式测试   */
	public void inputTest() {
		String input = "";
		Scanner myScanner = new Scanner(System.in);
		for (int i = 0;i < 5;i++){
			input += myScanner.next();
		}
		System.out.println("请输入账号:");
		System.out.println("输入账号为:"+ myScanner.next());
		System.out.println("请输入密码:");
		System.out.println("输入密码为:"+ myScanner.next());
		myScanner.close();
		int[] array = {123,456,789};
		System.out.println("输入的是:"+input);
	}

/*使用Properties类中的list方法迭代所有的系统属性*/
	public void printSystemProperties() {
		Properties proper = System.getProperties();
		proper.list(System.out);
		String a = new String("124456789");
		String b = new String("123456789");
		String c = "123456";
		String d = "123456";
		System.out.println("字符串比较:"+a.compareTo(b));
		System.out.println("字符串比较:"+a.equals(b));
		System.out.println("字符串比较:"+c.compareTo(d));
		System.out.println("字符串比较:"+c.equals(d));
	}
	
	
	public void showHex(byte[] array){
		
		
	}

}
